import axios from '../ajax/ajax.js'
export default {
    async getevaluate ({commit}) {
        console.log(1)
        const { code, data } = await axios.get("/api/evaluate")
        if (code == 200) {
            commit("getevaluate",data)
        }
    },
    async getgoods ({commit}) {
        const { code, data } = await axios.get("/api/goods")
        if (code == 200) {
            data.forEach((v,index) => {
                v.foods.forEach((j)=>{
                    j.count = 0
                    j.idx=index
                })
            });
            commit("getgoods",data)
        }
    },
    async getmerchant ({ commit }) {
        const { code, data } = await axios.get("/api/merchant")
        if (code == 200) {
            commit("getmerchant",data)
        }
    },
}